package br.com.naybee.domain.automacaoeletricabs;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import br.com.naybee.domain.portabs.PortaBs;
import br.com.naybee.framework.client.arduino.cliente.ArduinoClientSerial;
import br.com.naybee.framework.client.models.Model;

@Service
public class AutomacaoEletricaBs {

	@Autowired
	private PortaBs portaBs;

	public Model comandoIluminacao(Model param) {
		param.add("porta", portaBs.obterPorta(param));
		return ArduinoClientSerial.init().enviarDados(param).receberDados().getRetornoArduino();
	}

	public Model verificarConexaoArduino() {
		return ArduinoClientSerial.init().testarConexao().getRetornoArduino();
	}
}
